package com.taglab.chic.pagedata;

/**
 * @author Markus Kobler
 */
public class PageData {

  private String path;

  private String title;
  private String description;
  private String keywords;

  protected PageData(String path) {
    if( path == null ) {
      throw new IllegalArgumentException("path cannot be null");
    }
    this.path = path;
  }

  protected void setTitle(String title) {
    this.title = title;
  }

  protected void setDescription(String description) {
    this.description = description;
  }

  protected void setKeywords(String keywords) {
    this.keywords = keywords;
  }

  public String getPath() {
    return path;
  }

  public String getTitle() {
    return title;
  }

  public String getDescription() {
    return description;
  }

  public String getKeywords() {
    return keywords;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    return path.equals(((PageData) o).path);
  }

  @Override
  public int hashCode() {
    return path.hashCode();
  }

  @Override
  public String toString() {
    return "PageData[" + path + "]";
  }

}
